import { AbsDisPtSvc } from "../absdisptsvc";
import {CoordTRFUtil}  from "../../../common/tools/coordtool";

class DisEndPtSvc extends AbsDisPtSvc {
    constructor() {
        super();
        this.desc = "端点";
    }
    subDisplay(aborbPtInfo, map, mapInfo) {
        let halfSize = this.auxMarkSize;// / mapInfo.getScaling();
        halfSize = halfSize/2;
        let sp = CoordTRFUtil.world2Screen(aborbPtInfo.pt, mapInfo);
        map.beginPath();
        map.moveTo(sp.x - halfSize,sp.y - halfSize);
        map.lineTo(sp.x + halfSize,sp.y - halfSize);
        map.lineTo(sp.x + halfSize,sp.y + halfSize);
        map.lineTo(sp.x - halfSize,sp.y + halfSize);
        map.closePath();
        map.strokeStyle = aborbPtInfo.color.toHexString();
        map.stroke();
    }
}

export { DisEndPtSvc }